package com.hna.face;


import org.eclipse.paho.client.mqttv3.MqttException;
import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableScheduling;

import com.hna.face.mqtt.MqttService;


@ServletComponentScan
@SpringBootApplication
@EnableScheduling
@MapperScan("com.hna.face.mapper")
public class ClientApplication {
	private final static Logger log = LoggerFactory.getLogger(ClientApplication.class);

	
//	@Bean(name="mqttService")
/*	@Bean
	public MqttService createMqttService() {
		MqttService mqttService = null;
		try {
			log.info("Mqtt start");
			mqttService = new MqttService();
			mqttService.startReconnect();
        
		} catch (MqttException e1) {
			// TODO Auto-generated catch block
			log.error("MqttException:",e1);
		}
	
		log.info("Mqtt end:");
		if(mqttService== null) {
			log.error("null error");
		}
		else {
			log.info("success");
		}
        return mqttService;
	}*/
	
	

	public static void main(String[] args) {
		SpringApplication.run(ClientApplication.class, args);
	}
	
}
